/**
 * Copyright (c) 2018, dreamkaylee@foxmail.com All Rights Reserved.
 */
  
package com.limk.jconfig.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.limk.jconfig.entity.Permission;
import com.limk.jconfig.entity.Role;
import com.limk.jconfig.entity.User;
import com.limk.jconfig.mapper.PermissionMapper;
import com.limk.jconfig.mapper.RoleMapper;
import com.limk.jconfig.mapper.UserMapper;
import com.limk.jconfig.service.SystemService;

/**
 * 基础服务
 * @author limk
 * @date 2018年2月13日 上午11:27:04
 * @version 1.0
 */
@Service("systemService")
public class SystemServiceImpl implements SystemService {

	@Autowired
	private UserMapper userMapper;
	@Autowired
	private RoleMapper roleMapper;
	@Autowired
	private PermissionMapper permissionMapper;
	
	@Override
	public User selectUserByUserName(String username) {
		return userMapper.selectUserByUserName(username);
	}

	@Override
	public List<Role> selectRolesByUserId(Integer userid) {
		return roleMapper.selectRolesByUserId(userid);
	}

	@Override
	public List<Permission> selectPermissionByRoleId(Integer roleid) {
		return permissionMapper.selectPermissionByRoleId(roleid);
	}
	
}
  